package com.life.utils;

import javax.swing.ImageIcon;

import com.life.constants.Constants;

public class ImageUtil
{
    public ImageUtil()
    {
	
    }
    
    public static ImageIcon getImageIcon(Class caller, String url)
    {
	try
	{
	    if (Constants.IS_APPLET)
	    {
		String newUrl = "icons\\" + url.substring(url.lastIndexOf('\\'));
		return new ImageIcon(caller.getResource(newUrl));
	    } else
	    {
		return new ImageIcon(url);
	    }

	} catch (Exception ex)
	{
	    return null;
	}
    }
}
